package com.map.model;

import java.util.*;

public class BuildReq {
    private static   List<String> list;
    static {
        list = new ArrayList<String>();
        list.add("fef1386e6fc305dbedfeae2513f857bc");
        list.add("9b3030b4888960bd532d869deca7871c");
    }


    public static Map<String,Object> buildReq(Integer start,String query,String cityName){
        Map<String,Object> map = new HashMap<String, Object>();
        map.put("newmap","1");
        map.put("reqflag","pcmap");
        map.put("biz","1");
        map.put("from","webmap");
        map.put("da_par","baidu");
        map.put("pcevaname","pc4.1");
        map.put("qt","con");
        map.put("from","webmap");
        map.put("c","307");
        map.put("wd",query);
        map.put("wd2","");
        map.put("pn",start);
        map.put("nn",(start-1)*10);
        map.put("db","0");
        map.put("sug","0");
        map.put("addr","0");
        map.put("da_src","pcmappg.poi.page");
        map.put("on_gel","1");
        map.put("src","3");
        map.put("gr","3");
        map.put("l","13");
        map.put("auth","ASWeB8RP1eKUwdg8GGPdLUd8EKexcvHwuxHEVRNBRHTtBnlQADZZz1GgvPUDZYOYIZuVtcvY1SGpuBtGfyMxXwGccZcuVtPWv3GuxTthLAy9ofyK4O567Z=e0i3cEWe1GD8zv7u@ZPuEthyEx0iyfixA32XTNT372wrvUU2SGwbb9z8");
        map.put("device_ratio","2");
        map.put("tn","B_NORMAL_MAP");
        map.put("u_loc","12949620,4835681");
        map.put("ie","utf-8");
        map.put("b","(12834062.52,4671401.4;12848142.52,4693001.4)");
        map.put("t",(System.currentTimeMillis()/1000)+"");

        return map;

    }
    public static Map<String,Object> buildGaodeReq(Integer start,String query,String cityName){
        Map<String,Object> map = new HashMap<String, Object>();
        Random random = new Random();
        int n = random.nextInt(list.size());
        map.put("key",list.get(n));
        map.put("keywords",query);
        map.put("types","");
        map.put("city",cityName);
        map.put("citylimit","true");
        map.put("children","0");
        map.put("offset","20");
        map.put("page",start);//小于100
        map.put("building","");//传入建筑物POI编号之后，则只在该建筑物之内进行搜索
        map.put("floor","");//搜索楼层
        map.put("extensions","all");//此项默认返回基本地址信息；取值为all返回地址信息、附近POI、道路以及道路交叉口信息。
        map.put("sig","");
        map.put("output","json");
        map.put("callback","");

        return map;

    }

}
